package com.station.client;

import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Widget;


public class ExtFlexTable extends FlexTable {
    private int rows = 0;
    private int columns = 0;

    public ExtFlexTable() {
        setWidth("400");
        setCellSpacing(10);
        setCellPadding(10);
    }

    public void addRow(Widget ... w) {
        if (columns == 0)
            columns = w.length;
        if (columns == w.length)
            for (int i = 0; i < w.length; i++)
                setWidget(rows,i,w[i]);
        else
            throw new RuntimeException("Table can't have different column's count!");
        rows+=1;
    }

}
